<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        div{  }
        div{
            width: 200px;
            height: 200px;background-color: green;}
    </style>
    <script>
       /* window.onload= function () {
            var oDiv=document.getElementById('box');
            var oP=document.getElementById('p');
            oDiv.addEventListener("click", function () {
                //var a=oDiv.getAttribute("id");

            })
        }*/
    </script>
</head>
<body>
<div id="box">
    <p id="p"><span>我是span <a href="#">我是a</a></span><a href="#"></a></p>
</div>
<input type="button" value="点击" id="abc" onclick="abc()">
</body>
</html>
<script>
    var box=document.getElementById('box');
    var p=document.getElementById('p');
    var a=p.lastChild;
    alert(a)
    /*p.onclick= function (ev) {
        var ev=ev||window.event;
        var a=ev.target;
        console.log(ev)
    }*/
</script>
